<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>hasAttribute</title>
    </head>
    <body>
        <p id="demo">点击按钮查看按钮元件具有一个onclick属性。</p>
        <button  onclick="myFunction()">点我</button>
        <script src="hasAttribute.js"></script>
    </body>
</html>